const express = require( 'express' );

const userRouter = require( './routes/user-router' );
const studentRouter = require( './routes/student-router.js' );

const port = 8080 ;
const app = express();

// 处理静态资源
app.use( express.static( 'public' ) );

// 处理 application/x-www-form-urlencode 编码的 POST 表单
app.use( express.urlencoded( { extended: false } ) );

app.use( '/user' , userRouter );
app.use( '/student' , studentRouter );

app.listen( port , ()=> console.log( `正在监听${port}的连接` ));